package com.gyt.manager.service.impl;

import com.google.common.collect.Maps;
import com.gyt.manager.common.base.response.Page;
import com.gyt.manager.dao.risk.FaultTaskInfoMapper;
import com.gyt.manager.domain.req.TaskFlowReq;
import com.gyt.manager.domain.risk.FaultTaskInfo;
import com.gyt.manager.service.FaultTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * description.
 *
 * @author gyt create on 2021/6/10 12:21
 */
@Service
public class FaultTaskServiceImpl implements FaultTaskService {

    @Autowired
    private FaultTaskInfoMapper faultTaskInfoMapper;

    @Override
    public Page<FaultTaskInfo> findTaskFlowInfos(TaskFlowReq req) {
        Map<String, Object> param = Maps.newHashMap();
        param.put("fid", req.getId());
        param.put("fname", req.getName());
        param.put("ftroubleId", req.getTroubleType());
        Page.startPage(req.getPageNum(), req.getPageSize());
        List<FaultTaskInfo> list = faultTaskInfoMapper.selectByCondition(param);
        return Page.from(list);
    }
}
